/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.seguradora.view;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Diego
 */
public class ErrorsList {

    private List<UserError> errors;

    public ErrorsList() {
        this.errors = new ArrayList<UserError>();
    }

    public void addError(UserError errorLabel) {
        errors.add(errorLabel);
    }

    public Iterator<UserError> iterator() {
        return errors.iterator();
    }

    public int countErrors() {
        if (errors != null) {
            return errors.size();
        }
        return 0;
    }
}
